home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2005 June (DVD) / DPPRO0605DVD.iso / Install / program files / Borland / BDS / 3.0 / Demos / Delphi.Net / CLR / GraphEx / BMPDlg.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2004-10-22  |  2.5 KB  |  150 lines

  1. unit BMPDlg;
  2.  
  3.  
  4. interface
  5.  
  6. uses
  7.     Borland.Win32.Windows,
  8.     Borland.Delphi.Classes,
  9.     Borland.Vcl.Graphics,
  10.     Borland.Vcl.Forms,
  11.     Borland.Vcl.Controls,
  12.     Borland.Vcl.Buttons,
  13.     Borland.Vcl.StdCtrls,
  14.     Borland.Vcl.ExtCtrls;
  15.  
  16. type
  17.   TNewBMPForm = class(TForm)
  18.     OKBtn: TButton;
  19.     CancelBtn: TButton;
  20.     Bevel1: TBevel;
  21.     Label1: TLabel;
  22.     WidthEdit: TEdit;
  23.     Label2: TLabel;
  24.     HeightEdit: TEdit;
  25.   private
  26.     { Private declarations }
  27.         procedure InitializeControls;
  28.   public
  29.     { Public declarations }
  30.         constructor Create(AOwner: TComponent); override;
  31.   end;
  32.  
  33. var
  34.   NewBMPForm: TNewBMPForm;
  35.  
  36. implementation
  37.  
  38.  
  39. constructor TNewBMPForm.Create(AOwner: TComponent);
  40. begin
  41.     inherited;
  42.     InitializeControls;
  43. end;
  44. procedure TNewBMPForm.InitializeControls;
  45. begin
  46.   // Initalizing all controls...
  47.     Bevel1:= TBevel.Create(Self);
  48.     Label1:= TLabel.Create(Self);
  49.     Label2:= TLabel.Create(Self);
  50.     OKBtn:= TButton.Create(Self);
  51.     CancelBtn:= TButton.Create(Self);
  52.     WidthEdit:= TEdit.Create(Self);
  53.     HeightEdit:= TEdit.Create(Self);
  54.  
  55.     // Form's PMEs'
  56.     Left:= 253;
  57.     Top:= 114;
  58.     BorderStyle:= bsDialog;
  59.     Caption:= 'Bitmap Dimensions';
  60.     ClientHeight:= 120;
  61.     ClientWidth:= 233;
  62.     Font.Color:= clBlack;
  63.     Font.Height:= -11;
  64.     Font.Name:= 'MS Sans Serif';
  65.     Font.Style:= [];
  66.     Position:= poScreenCenter;
  67.     PixelsPerInch:= 96;
  68.     
  69.     with Bevel1 do
  70.     begin
  71.         Parent:= Self;
  72.         Left:= 8;
  73.         Top:= 8;
  74.         Width:= 217;
  75.         Height:= 65;
  76.         Shape:= bsFrame;
  77.         IsControl:= True;
  78.     end;
  79.     
  80.     with Label1 do
  81.     begin
  82.         Parent:= Self;
  83.         Left:= 24;
  84.         Top:= 16;
  85.         Width:= 23;
  86.         Height:= 11;
  87.         Caption:= '&Width';
  88.         FocusControl:= WidthEdit;
  89.     end;
  90.     
  91.     with Label2 do
  92.     begin
  93.         Parent:= Self;
  94.         Left:= 24;
  95.         Top:= 48;
  96.         Width:= 26;
  97.         Height:= 11;
  98.         Caption:= '&Height';
  99.         FocusControl:= HeightEdit;
  100.     end;
  101.     
  102.     with OKBtn do
  103.     begin
  104.         Parent:= Self;
  105.         Left:= 32;
  106.         Top:= 84;
  107.         Width:= 77;
  108.         Height:= 27;
  109.         Caption:= 'OK';
  110.         Default:= True;
  111.         ModalResult:= 1;
  112.         TabOrder:= 0;
  113.     end;
  114.     
  115.     with CancelBtn do
  116.     begin
  117.         Parent:= Self;
  118.         Left:= 116;
  119.         Top:= 84;
  120.         Width:= 77;
  121.         Height:= 27;
  122.         Cancel:= True;
  123.         Caption:= 'Cancel';
  124.         ModalResult:= 2;
  125.         TabOrder:= 1;
  126.     end;
  127.     
  128.     with WidthEdit do
  129.     begin
  130.         Parent:= Self;
  131.         Left:= 88;
  132.         Top:= 12;
  133.         Width:= 121;
  134.         Height:= 24;
  135.         TabOrder:= 2;
  136.     end;
  137.     
  138.     with HeightEdit do
  139.     begin
  140.         Parent:= Self;
  141.         Left:= 88;
  142.         Top:= 44;
  143.         Width:= 121;
  144.         Height:= 24;
  145.         TabOrder:= 3;
  146.     end;
  147.     ActiveControl:= OKBtn;
  148. end;
  149. end.
  150.